package com.paipai.controller;

import com.paipai.dto.Auction;
import com.paipai.feign.AuctionFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.math.BigDecimal;

@Controller
@RequestMapping("/auction")
public class AuctionController {

    @Autowired
    AuctionFeign auctionFeign;

    @RequestMapping("/addAuction")
    @ResponseBody
    public String addAuction( Auction auction) {
       return auctionFeign.addAuction(auction);
    }

    @RequestMapping("/getCurrentPrice")
    @ResponseBody
    public BigDecimal getCurrentPrice(long roundId,BigDecimal startPrice) {
        return auctionFeign.getCurrentPrice(roundId,startPrice);
//        return new BigDecimal(6000 + "");
    }
}
